﻿using SqlsugarBlog.IRepository;
using SqlsugarBlog.Repository;
using SqlsugarBlog.IService;
using SqlsugarBlog.Service;

namespace SqlsugarBlog.WebApi
{
    public static class IOCExtension
    {
        public static IServiceCollection AddIOC(this IServiceCollection services)
        {
            services.AddScoped<IBlogNewsRepository,BlogNewsRepository>();
            services.AddScoped<IBlogNewService, BlogNewsService>();
            services.AddScoped<IBlogTypeRepository, BlogTypeRepository>();
            services.AddScoped<IBlogTypeService, BlogTypeService>();
            services.AddScoped<IWritterInfoRepository, WritterInfoRepository>();
            services.AddScoped<IWritterInfoService, WritterInfoService>();
            return services;
        }
    }

    public static class WebApiExtensions
    {
        public static void GetApi(this WebApplication app)
        {
            app.MapGet("/BlogNews/Query", () =>
            {
            }).WithTags("查询所有博客");
        }
    }
}
